<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>小飞象-会员中心-调整单量</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/font_810097_mgs6xzz1oj.css">
    <link rel="stylesheet" href="../css/common/reset.css">
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/reset-layui.css">
    <link rel="stylesheet" href="../css/header.css">
    <link rel="stylesheet" href="../css/common/nav.css">
    <link rel="stylesheet" href="../css/common/aside.css">
    <link rel="stylesheet" href="../css/common/content.css">
    <link rel="stylesheet" href="../css/readjustNum.css">
</head>

<body>
    <header>
        <div class="wrapper">
            <div class="clearfix headerBox">
                <h1 class="fl logo">
                    <a href="">小飞象</a>
                </h1>
                <!-- <div class="fl alipayName">支付宝充值账号: <b class="redColor">156****8656</b>开户人: <b class="redColor">陈小窝</b></div> -->
                <div class="fr logOut">退出</div>
                <div class="fr userName"></div>
            </div>
        </div>
    </header>
    <div class="mhNav">
        <ul class="navMenuBox">
            <li>
                <a href="../index.html">
                    飞象首页
                </a>
            </li>
            <li class="memberUser">
                <a href="javascript:;" class="active">
                    会员中心
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="basicInfo.html">基本资料</a>
                    </li>
                    <li>
                        <a href="storeMage.html">店铺管理</a>
                    </li>
                    <li>
                        <a href="readjustNum.html">调整单量</a>
                    </li>
                    <li>
                        <a href="/goodsMage.html">商品管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    计划管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../plan/newPlan.html">新建计划</a>
                    </li>
                    <li>
                        <a href="../plan/planMage.html">计划管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    订单管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../order/orderMage.html">订单管理</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="javascript:;">
                    资金管理
                    <!-- <i class="iconfont icon-arrow-up mhArrowIcon"></i>
                    <i class="iconfont icon-arrow-down mhArrowIcon"></i> -->
                </a>
                <ul class="mhColumnSide">
                    <li>
                        <a href="../capital/inAccout.html">账号充值</a>
                    </li>
                    <li>
                        <a href="../capital/transferMage.html">转账管理</a>
                    </li>
                    <li>
                        <a href="../capital/orderMage/dailyTaskDes.html">订单信息</a>
                    </li>
                    <li>
                        <a href="../capital/expressForm.html">获取快递底单</a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="">在线客服</a>
            </li>
        </ul>
    </div>
    <div class="wrapper mainBomContent">
        <!-- 会员中心-基本资料 -->
        <div class="asideMenu">
            <ul>
                <li class="title">
                    <i class="iconfont icon--"></i> 会员中心
                </li>
                <li>
                    <a href="basicInfo.html">基本资料</a>
                </li>
                <li>
                    <a href="storeMage.html">店铺管理</a>
                </li>
                <li class="active">
                    <a href="readjustNum.html">调整单量</a>
                </li>
                <li>
                    <a href="/goodsMage.html">商品管理</a>
                </li>
            </ul>
        </div>
        <div class="rightContent">
            <div class="readjustView">
                <h3>
                    <i class="iconfont icon-naozhong"></i>
                    补充单量调整说明：
                </h3>
                <div class="infoBox">
                    <p>1、平台以店铺为单位对补单量进行收费。</p>
                    <p>2、店铺补单量由卖家自助购买，有效期为30天。立即购买，立即扣费。</p>
                    <p>3、调整单量原则：但凡购买成功，一律不进行退费操作。</p>
                </div>
                <h4>已绑定店铺信息</h4>
                <table class="layui-table">
                    <colgroup>
                        <col width="200">
                        <col>
                        <col width="120">
                        <col>
                        <col width="200">
                    </colgroup>
                    <thead>
                        <tr>
                            <th>平台类型</th>
                            <th>店铺名称</th>
                            <th>补单量(单/天)</th>
                            <th>到期时间</th>
                            <th>操作按钮</th>
                        </tr>
                    </thead>
                    <tbody class="readjustNum">
                        <!-- <tr>
                            <td>天猫</td>
                            <td>陈小窝小聚</td>
                            <td>
                                无限制
                            </td>
                            <td>
                                2018/09/19
                                <p class="redColor">
                                    <i class="iconfont icon-naozhong"></i>4天后过期
                                </p>
                            </td>
                            <td>
                                <a href="javascript:void(0)" class="readMore fChangNum">
                                    调整单量</a>
                                <a href="javascript:void(0)" class="addMoneyBtn fAddMoney">
                                    续费</a>
                            </td>
                        </tr> -->
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <script src="../js/jquery.min.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script>
        $(".mhNav .navMenuBox > li > a").click(function (event) {
            if ($(this).siblings('ul').is(':visible')) {
                $(this).siblings('ul').stop(true, true).slideUp();
                $(this).removeClass('active')
            } else {
                $(this).siblings('ul').stop(true, true).slideDown().parents('li').siblings().find('ul').stop(true, true).slideUp();
                $(this).addClass('active').parents('li').siblings().find('a').removeClass('active');
            }
        });
    </script>
    <script>
        var mid = $.cookie('id');
        console.log("你是我的商户ID", mid);
        if (mid == null || mid == "" || !mid || mid == undefined) {
            window.location.href = "/login.html";
        }
        layui.use('layer', function () {
            var layer = layui.layer;
            var str = "";
            $.ajax({
                url: 'http://47.92.174.143:8888/v1/client/shop/merchants/' + mid,
                type: 'GET',
                dataType: 'json',
                contentType: "application/json;charset=utf-8",
                // data: JSON.stringify(JdateJson),
                success: function (data) {
                    console.log("数据是谁", data.data);
                    var _Success = data.code;
                    if (_Success == 200) {
                        // layer.msg("请求成功");
                        var str = "";
                        for (var i = 0; i < data.data.length; i++) {
                            str += '<tr>';
                            str += '<td>' + data.data[i].shopPlatform + '</td>';
                            str += '<td>' + data.data[i].shopName + '</td>';
                            str += '<td>';
                            str += '' + data.data[i].billCount + '';
                            str += '</td>';
                            str += '<td>';
                            str += '' + data.data[i].expirationTime + '';
                            str += '<p class="redColor">';
                            str += '</p>';
                            str += '</td>';
                            str += '<td>';
                            str += '<a href="javascript:void(0)" class="readMore fChangNum" data-id=' + i + '>';
                            str += '调整单量</a>';
                            str += '</td>';
                            str += '</tr>';
                        }
                        $(".readjustNum").append(str);
                        $(".fChangNum").on("click", function (e) {
                            var changeNumInfo = $(e.target).attr("data-id");
                            console.log("调整单量", changeNumInfo);
                            $.cookie("changeNumInfo", JSON.stringify(data.data[changeNumInfo]));
                            layer.open({
                                type: 2 //此处以iframe举例
                                , title: '调整单量'
                                , area: ['650px', '463px']
                                , shadeClose: true //开启遮罩关闭
                                , offset: 'auto'
                                , scrollbar: true
                                , content: ['readjust/editNum.html', 'no']
                                , btn2: function () {
                                    layer.closeAll();
                                }
                                , zIndex: layer.zIndex //重点1
                            });
                        });
                        $(".fAddMoney").click(function () {
                            layer.open({
                                type: 2 //此处以iframe举例
                                , title: '提交天猫店铺审核资料'
                                , area: ['700px', '360px']
                                , shadeClose: true //开启遮罩关闭
                                , offset: 'auto'
                                , scrollbar: true
                                , content: ['readjust/editMoney.html']
                                , btn2: function () {
                                    layer.closeAll();
                                }
                                , zIndex: layer.zIndex //重点1
                            });
                        });
                    } else {
                        layer.msg(data.data);
                    }
                }

            });
            $(".logOut").on("click", function () {
                $.cookie('mid', null);
                location.href = '/login.html';
            });
            $.ajax({
                type: "get",
                url: "http://47.92.174.143:8888/v1/client/merchants/" + mid,
                dataType: 'json',
                success: function (data) {
                    console.log("请求数据为", data.data)
                    // 存储总额
                    if (data.data == null || !data.data) {
                        layer.msg('数据出错,请重新登录', {
                            icon: 5,//提示的样式
                            time: 6000, //6秒关闭（如果不配置，默认是3秒）//设置后不需要自己写定时关闭了，单位是毫秒
                            end: function () {
                                location.href = '/login.html';
                            }
                        });
                    } else {
                        $(".userName").html(data.data.loginId);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // console.log(XMLHttpRequest);
                    // console.log(textStatus);
                    // console.log(errorThrown);
                }
            });
        });

    </script>
</body>

</html>